#ifndef IFACILITYLOCATIONSOLVER_H_
#define IFACILITYLOCATIONSOLVER_H_

#include <vector>

#include <boost/shared_ptr.hpp>

#include "graphsupport/graph/FacilitiesGraph.h"

class IFacilityLocationSolver
{
public:
	/**
	 *
	 * isFacilityOpenVec, cityWitnessVec contain base ( not perfect ) solution,
	 * or empty solution ( isFacilityOpenVec = < 0, 0 ... >, cityWitnessVec = < -1, -1 ... > )
	 * solver optimises the solution ( or creates one if it was empty )
	 *
	 * this design is useful if one wants to configure multi-heuristic solver
	 *
	 */
	virtual bool solve(
		FacilitiesGraph & fgraph,
		std::vector< char > & isFacilityOpenVec,
		std::vector< int > & cityWitnessVec
	) = 0;

	virtual ~IFacilityLocationSolver();

public:
	static FacilitiesGraph::FacilityPriceType computeCost(
		FacilitiesGraph & fgraph,
		const std::vector< char > & isFacilityOpenVec,
		const std::vector< int > & cityWitnessVec
	);
};
typedef boost::shared_ptr< IFacilityLocationSolver > IFacilityLocationSolverPtr;

class SolutionProcessException
{
public:
	SolutionProcessException( const char * message ) : message( message ) {}
	virtual ~SolutionProcessException() {}
	const char * message;
};

#endif /* IFACILITYLOCATIONSOLVER_H_ */
